<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        //用户名必须为6-15位的数字字母下划线
        /*var reg_username = /^\w{6,15}$/;
        var username = "123456adsasdasdasda";
        alert(reg_username.test(username));*/
        //密码必须为6-15位的数字字母下划线，不能以数字开头
        /*var reg_password = /^[a-zA-Z_]\w{5,14}$/;
        var password = "a123456";
        alert(reg_password.test(password));*/
        //验证性别只能为男或女
        /*var reg_sex = /^[男女]$/;
        var sex = "男";
        alert(reg_sex.test(sex));*/
        //验证年龄为18-99岁之间
        /*var reg_age = /^([2-9][0-9]|1[89])$/;
        var age = "188";
        alert(reg_age.test(age));*/
        //验证正确的手机号
        var reg_tel = /^1[2-9]\d{9}$/;
        //验证正确的身份证号码
        var reg_card = /^[1-9]\d{16}[0-9X]$/;
        //验证正确的邮箱地址
        var reg_email = /^\w+@\w+\.(com|cn|com\.cn)$/;//123@qq.com
    </script>
</head>
<body>

</body>
</html>